import os
pathname = os.getcwd()
print(pathname)
# 打开文件
file = open(pathname + '/test.txt', mode='r', encoding='utf8')
# 读取文件
content = file.read()
print(content)
# 关闭文件
file.close()